class Solution:
    def validMountainArray(self, A: List[int]) -> bool:
        direction=True
        reverseindex=0
        if len(A)<3:
            return False
        for i in range(len(A)-1):
            if not direction:
                if A[i]<A[i+1]:
                    return False
            if A[i]>A[i+1]:
                if direction:
                    reverseindex=i
                    direction=False
            if A[i]==A[i+1]:
                return False
        if reverseindex==0:
            return False
        else:
            return True